﻿@model PagedList<HMoPro.Models.RescourcerList>
@using Webdiyer.WebControls.Mvc;

@{
    ViewBag.Title = "Index";
}

 

<div class="row">
    <div class="col-xs-12 text-right">
        @Html.ActionLink("+", "ManageCreate", "Resource", new { @class = "button button-plain button-border button-circle", @id = "add" })
    </div>
</div>
@foreach (var item in Model)
{
    <div class="showTm" style="padding:15px; margin:10px 35px 20px 35px;position:relative;overflow:hidden;zoom;">
        <div class="row">
            <div class="col-xs-5 col-sm-3">
                <img src="../../Uploads/@item.rescourceid/@item.ImageshotFileName" class="img-responsive" />
                <div class="dd">
                        <p class="pull-left">
                            <span class="width-bf db">@Html.DisplayFor(modelItem => item.PlayTime)</span>
                            <span class="width-bf dz">@Html.DisplayFor(modelItem => item.PraiseTime)</span>
                        </p>
                        @{Html.RenderAction("browseListIndex", new { resourceid = item.rescourceid });}
                </div>
            </div>
            <div class="col-xs-7 col-sm-9">
                <h4 style="margin-top:0;padding-left:5px;">
                    @Html.DisplayFor(modelItem => item.Title)
                    <small>
                        @if (User.IsInRole("NomalUser"))
                        {
                            if (item.ResCheck == 0)
                            {
                                <small> 未审核</small>
                            }
                            if (item.ResCheck == 1)
                            {
                                <small> 已通过</small>
                            }
                            if (item.ResCheck == 2)
                            {
                                <small> 不通过</small>
                            }
                            if (item.ResCheck == 3)
                            {
                                <small> 未提交</small>
                            }
                        }
                    </small>
                </h4>
                <div class="row">
                    <div class="col-xs-12 col-sm-4">
                        <p>上传用户：@Html.DisplayFor(modelItem => item.username)</p>
                    </div>
                    <div class="col-xs-12 col-sm-8 text-right">
                        <p>上传时间：@Html.DisplayFor(modelItem => item.DateTimeStamp) &emsp; 最后修改时间：@Html.DisplayFor(modelItem => item.LatestModfyDate)</p>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <p>说明：@Html.DisplayFor(modelItem => item.Descrb)</p>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <p>路径：@Html.DisplayFor(modelItem => item.PackageFileName)</p>
                    </div>
                </div>
            </div>
        </div>
        <div style="position:absolute;bottom:15px;right:25px;">
            @if ((item.ResCheck == 0 || item.ResCheck == 1) && User.IsInRole("NomalUser"))
            {

            }
            else
            {
                @Html.ActionLink("上传资源包", "ZipUploadFile", new { resourceid = item.rescourceid }, new { @class = "button button-raised button-pill button-inverse button-small" })<span>&emsp;</span>
                @Html.ActionLink("修改", "EditResourceFirstPart", new { resourceid = item.rescourceid }, new { @class = "button button-raised button-pill button-inverse button-small" })<span>&emsp;</span>
                @Html.ActionLink("删除", "DeleteComfirm", new { resourceid = item.rescourceid }, new { @class = "button button-raised button-pill button-inverse button-small" })

                if (User.IsInRole("NomalUser"))
                {
                    @Html.ActionLink("提交审核", "TijiaoShenHe", new { resourceid = item.rescourceid }, new { @class = "button button-primary button-tiny" })
                }




            }
            @*@if (User.IsInRole("NomalUser") && (item.ResCheck == 3))*@

        </div>
    </div>
}

@*<table>
    <tr>
        <th>
            标题
        </th>
        <th>
           说明
        </th>
        <th>
           压缩包
        </th>
        <th>
           截图
        </th>
        <th>
           上传时间
        </th> 
        <th>
           上传用户
        </th>
        <th>最后修改时间</th>
        <th>播放数</th>
        <th>点赞数</th>
        @if(User.IsInRole("NomalUser"))
        {
        <th>审核状态</th>}
        <th style="width:100px">操作</th>
    </tr>*@

@*@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Descrb)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PackageFileName)
        </td>
        <td>
            <img src="../../Uploads/@item.rescourceid/@item.ImageshotFileName" onload="javascript:DrawImage(this,300,200)" />
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateTimeStamp)
        </td>
        <td>
              @Html.DisplayFor(modelItem => item.username)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LatestModfyDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PlayTime)
        </td>
            <td>
            @Html.DisplayFor(modelItem => item.PraiseTime)
        </td>
        @if(User.IsInRole("NomalUser"))
        {
         if (item.ResCheck == 0) {
        <td> 未审核</td>
        }
        if (item.ResCheck == 1) {
        <td> 已通过</td>
        }
          if (item.ResCheck == 2) {
        <td> 不通过</td>
          }
          if (item.ResCheck == 3)
          {
        <td> 未提交</td>
          }
        }
        <td style="width:100px">
            @Html.ActionLink("修改", "EditResourceFirstPart", new { resourceid = item.rescourceid }) |
            @Html.ActionLink("删除", "DeleteComfirm", new { resourceid = item.rescourceid })
             @if (User.IsInRole("NomalUser") && (item.ResCheck == 3))
             {
           @Html.ActionLink("提交审核", "TijiaoShenHe", new { resourceid = item.rescourceid })
             }
        </td>
    </tr>
}

</table>*@

        @Html.Pager(Model,new PagerOptions()
        {
    PageIndexParameterName = "id",
    ShowPageIndexBox = true,
    ShowGoButton = true,
    PageIndexBoxWrapperFormatString = "跳转到第{0}页"})

<script>
    $("#carousel-hm").css("display", "none");
    $("#f2 a").html("<font> "+$("#f2 a").text()+" </font>")
    $("#f2 a").addClass("selected");
</script>